Conversation
… native deprecation gate
ViniTou
force-pushed
the
phpunit-11-deprecation-gate
branch
from
September 17, 2026 15:12
159cbe3 to
b1978fb
Compare
…HPUnit 9 convert*ToExceptions strictness
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description:
SYMFONY_DEPRECATIONS_HELPERthresholds are dead under PHPUnit >=10: phpunit-bridge no longer registers aDeprecationErrorHandler, sotrigger_deprecation()calls were silently ignored (this repo had it set todisabled=1, which was itself a no-op). This replaces it with PHPUnit 11's native gate:failOnDeprecation+ a<source baseline="...">scoped tosrc/lib,src/bundleandsrc/contracts, so CI fails only on NEW deprecations.The single config (
phpunit.xml) is gated, with an empty baseline (0 pre-existing issues, confirmed identical when regenerated under both PHP 8.3 and PHP 8.4), after removing the deadSYMFONY_DEPRECATIONS_HELPERenv line. Verified with atrigger_deprecation()probe insrc/lib/PurgeClient/LocalPurgeClient.php::__construct()(exercised bytests/lib/PurgeClient/LocalPurgeClientTest.php): the suite correctly failed, then passed again after removal (git diff -- srcclean).composer check-csandphpstan analyseare unchanged (clean).To refresh the baseline: ensure
vendor/is a real (non-symlinked) directory with PHPUnit 11 installed, then runvendor/bin/phpunit -c phpunit.xml --generate-baseline phpunit.baseline.xml.Base branch:
6.0(this repo's PHPUnit 11 migration PR is already merged).ignoreIndirectDeprecationsis deliberatelyfalse: PHPUnit classifies a Symfony deprecation caused by our code as "indirect" (calleedeprecation-contracts/function.php, caller the vendor method), sotruewould silently drop every deprecated-vendor-API usage. Vendor-originated baseline entries are expected; new ones fail the build until the baseline is refreshed on purpose.failOnWarning="true"andfailOnNotice="true"onphpunit.xml: PHPUnit 9'sconvertErrorsToExceptions/convertNoticesToExceptions/convertWarningsToExceptionswere dropped in PHPUnit 10+ and their replacements default tofalse, so notices and warnings had silently stopped failing the run.symfony/phpunit-bridgedependency and itsSymfonyExtensionbootstrap line fromphpunit.xml: the extension only wiresClockMock/DnsMock, and its deprecation handler is inert under PHPUnit >=10; the repo has noClockMock/DnsMock/ExpectDeprecationTrait/expectDeprecation()/SYMFONY_DEPRECATIONS_HELPERusage, so it was dead weight.composer why symfony/phpunit-bridgeconfirms nothing else in the project requires it.For QA:
N/A
Documentation:
N/A